package org.sunnyleaf.votedemo.client;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import org.sunnyleaf.votedemo.client.data.*;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
	String greetServer(String name);
	
	LoginResponse checkLogin();
	
	Vote addNewVote(NewVoteRequest r);	
	
	Vote getVoteByID( Long id );
	
//	String saveObj(Object obj);
	
	String deleteVoteByID( Long id);
   
	/**
    * @gwt.typeArgs <org.sunnyleaf.votedemo.client.data.Vote>
    */
	List<Vote> getVotesOwnsTo(String owner);
   
	/**
    * @gwt.typeArgs <org.sunnyleaf.votedemo.client.data.Vote>
    */		
	List<Vote> getVotesAttendedBy(String user);
	
    /**
    * @gwt.typeArgs <org.sunnyleaf.votedemo.client.data.VoteRecord>
    */
	List<VoteRecord> getVoteRecords( Long voteId );	
    /**
    * @gwt.typeArgs <org.sunnyleaf.votedemo.client.data.VoteRecord>
    */	
	List<VoteItem> getVoteItems( Long voteId );

	String saveVote(Vote vote);
	String saveVoteRecord(VoteRecord record);
	
	VoteRecord getVoteRecord(Long voteId, String account);

	VoteItem getVoteItemByID(Long id);


	
}
